package com.ym.medical.service;

import com.ym.core.utils.tkmybatis.IBaseSV;
import com.ym.medical.domain.entity.DoctorServiceItemEntity;
import com.ym.medical.domain.entity.PhoneRuleEntity;
import com.ym.medical.domain.entity.TextRuleEntity;
import com.ym.medical.domain.param.DoctorPhoneSettingModel;
import com.ym.medical.domain.param.InquiryOrderParam;
import com.ym.medical.domain.param.TextRuleParam;
import com.ym.medical.domain.vo.DoctPhoneRuleItemVo;
import com.ym.medical.domain.vo.DoctorServiceItemVO;
import com.ym.medical.domain.vo.DoctorServicePriceVo;
import com.ym.medical.domain.vo.OpenServiceListVo;
import com.ym.medical.domain.vo.OrderVo;
import com.ym.medical.domain.vo.PhoneAppointmentTimeVo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 电话问诊规则Service接口
 *
 * @author ym
 * @date 2020-09-14
 */
public interface IDoctorServiceItemSV extends IBaseSV<DoctorServiceItemEntity> {

	/***
	 * 医生服务项启用失效
	 * @return
	 */
	Map<String, Object> disOrEnableItem(DoctorServiceItemEntity doctorServiceItem);

	/**
	 * 医生服务项查询
	 *
	 * @param doctId
	 * @return
	 */
	List<DoctorServiceItemEntity> getSrviceItem(Long doctId);

	/**
	 * 图文设置信息
	 *
	 * @param serviceItem
	 * @param  ruleModel
	 * @return
	 */
	int graphicSet(DoctorServiceItemEntity serviceItem , TextRuleParam ruleModel);

	/**
	 * 图文问诊列表
	 *
	 * @return
	 */
	List<TextRuleEntity> getTextRules();

	/**
	 * 图文问诊单价
	 *(改表 安医生id 查询)
	 * @param doctId
	 * @return
	 */
	List<DoctorServicePriceVo> selectServicePrice(Long doctId);

	/**
	 * 添加图文规则以及单价
	 * @param textRuleModel
	 * @return
	 */
	//int addTextRule(TextRuleModel textRuleModel);

	/**
	 * 删除图文规则
	 *
	 * @param textRuleId
	 * @return
	 */
	int deleteTextRule(Long textRuleId);

	/**
	 * 图文问规则诊更改
	 * @param textRuleModel
	 * @return
	 */
	//int updateTextRule(TextRuleModel textRuleModel);

	/**
	 * 电话时间设置
	 *
	 * @param doctorPhoneSettingModel
	 * @return
	 */
	int phoneSetting(List<DoctorPhoneSettingModel> doctorPhoneSettingModel);


	/***
	 * 电话时间设置列表
	 * @param docServId
	 * @return
	 */
	List<PhoneAppointmentTimeVo> getPhoneSets(Long docServId);



	/***
	 * 默认三条电话问诊规则数据
	 * @return
	 */
	List<PhoneRuleEntity> getDefaultPhoneRule();

	/***
	 * 电话规则默认值更改   (已注释)
	 * @param phoneRuleId
	 * @return
	 */
	int upDefaultPhoneRule(Long phoneRuleId);

	/**
	 * 添加电话规则以及对应的单价  (已注释)
	 * @param phoneRuleModel
	 * @return
	 */
	//int addPhoneRule(PhoneRuleModel phoneRuleModel);

	/**
	 * 更改电话规格及单价
	 *
	 * @param phoneRuleModel
	 * @return
	 */
	int upPhoneRuleAndPrice(DoctPhoneRuleItemVo phoneRuleModel);

	/**
	 * 查询默认规则对应的单价
	 * @param docServId
	 * @return
	 */
	//DoctorServicePrice selectSingleServicePrice(Long docServId);

	/**
	 * 图文问诊设置更改
	 * @param doctorTextSetting
	 * @return
	 */
	//int upGraphicSet(DoctorTextSetting doctorTextSetting);

	/***
	 * 电话规则及单价列表
	 * 改表后医生id查询)
	 * @param doctId(
	 * @return
	 */
	List<DoctorServicePriceVo> selectPhoneRulePrices(Long doctId);


	/**
	 * 医生设置的电话预约时间列表
	 *
	 * @param doctServId
	 * @return
	 */
	Map<String, Object> phoneAppointmentTime(Long doctServId);

	/**
	 * 电话咨询订单生成
	 *
	 * @param inquiryOrderModel
	 * @return
	 */
	OrderVo generateOrders(InquiryOrderParam inquiryOrderModel);

	/**
	 * 查询医生开通的服务项,包含价格
	 *
	 * @param doctorId
	 * @return
	 */
	List<OpenServiceListVo> openServiceList(Long doctorId);

	/***
	 * 电话相关设置是否完整
	 * @param doctServId
	 * @return
	 */
	int phoneEffectiveState(Long doctServId);

	/***
	 * 查询图文默认的规则
	 * @return
	 */
	List<TextRuleEntity> selectDefaultItem();

	/**
	 * 优惠券支付应付价格
	 * @param inquiryOrderModel
	 * @return
	 */
	Map<String,BigDecimal> couponUse(InquiryOrderParam inquiryOrderModel);

	/**
	 * 相同患者下单判断是否存在
	 * 	未结束订单
	 * @param patientId
	 * @param doctId
	 * @return
	 */
	OrderVo samePatientLimit(Long patientId, Long doctId);

	/**
	 * 生效时间返回
	 * @return
	 */
	Date getValidTime();


	/**
	 * 失效时间返回
	 * @return
	 */
	Date getInvalidTime();

	/**
	 * 义诊设置
	 * @param textRuleModel
	 * @return
	 */
	int freeClinic(TextRuleParam textRuleModel, Long doctId);

	/**
	 * 义诊服务修改
	 * @param textRuleModel
	 * @return
	 */
	int upFreeClinic(TextRuleParam textRuleModel,Long doctId);
}
